Component({
    properties: {
        title: String,
        subtitle: String,
        prefix: String,
        content: {
            type: String,
            value: "",
            observer: function(t) {
                this.setData({
                    value: t
                });
            }
        },
        placeholder: String,
        top: String,
        type: {
            type: String,
            value: "text"
        },
        showCancel: {
            type: Boolean,
            value: !0
        },
        cancelText: {
            type: String,
            value: "取消"
        },
        confirmText: {
            type: String,
            value: "确定"
        },
        maxlength: {
            type: Number,
            value: -1
        },
        notEmpty: {
            type: Boolean,
            value: !1
        },
        anyvalue: {
            type: Boolean,
            value: !1
        }
    },
    data: {
        value: "",
        autoFcous: !1
    },
    ready: function() {
        this.setData({
            disabled: this.data.notEmpty
        }), this.modal = this.selectComponent("#modal");
    },
    methods: {
        onInput: function(t) {
            var e = t.detail.value;
            this.setData({
                value: e
            }), this.data.notEmpty && this.setData({
                disabled: !e.trim()
            });
        },
        onConfirm: function() {
            var t = this.data, e = t.value, a = t.disabled, i = t.notEmpty;
            (t.anyvalue || e && !a) && this.triggerEvent("confirm", {
                value: i ? e.trim() : e
            }, {});
        },
        onCancel: function() {
            this.hide(), this.triggerEvent("cancel", {}, {});
        },
        show: function() {
            var t = this, e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "";
            this.modal.show(), this.setData({
                value: this.data.notEmpty ? e.trim() : e
            }), setTimeout(function() {
                return t.setData({
                    autoFcous: !0
                });
            }, 200);
        },
        hide: function() {
            this.modal.hide(), this.setData({
                value: "",
                autoFcous: !1
            });
        }
    }
});